package com.njtoyo.taxi.admin.rest.pojo.dto;

import lombok.Data;
import lombok.experimental.Accessors;

import java.math.BigDecimal;

@Data
@Accessors(chain = true)
public class RideCancelRuleDto {

    /**
     * 实时单
     */
    private Realtime realtime;

    /**
     * 预约单
     */
    private Appointment appointment;


    @Data
    @Accessors(chain = true)
    public static class Realtime {

        /**
         * 未到达上车点
         */
        private FreeCancelTime freeCancelTime;

        private CancelTime[] cancelTime;



        @Data
        @Accessors(chain = true)
        public static class CancelTime {
            private Integer waitTime;
            private BigDecimal penalty;

            public CancelTime(Integer waitTime, BigDecimal penalty) {
                this.waitTime = waitTime;
                this.penalty = penalty;

            }
        }


        @Data
        @Accessors(chain = true)
        public static class FreeCancelTime {
            //司机接单之后cancelMinute分钟无责取消
            private Integer cancelMinute;

            //每天1-4无责取消次数
            private Integer cancelDailyTime;
            //每天1-4无责取消时间段
            private int[] cancelDailyPeriod;

        }
    }

    @Data
    @Accessors(chain = true)
    public static class Appointment {

        private Integer freeAppointmentTime;

        private BigDecimal driverWaitDefaultPenalty;

        /**
         * 未到达上车点
         */
        private DriverUnreached driverUnreached;

        /**
         * 到达上车点
         */
        private DriverReached[] driverReached;


        @Data
        @Accessors(chain = true)
        public static class DriverUnreached {
            private Integer cancelTime;
            private BigDecimal penalty;
        }
        @Data
        @Accessors(chain = true)
        public static class DriverReached {
            private Integer cancelTime;
            private BigDecimal penalty;

            public DriverReached(Integer cancelTime, BigDecimal penalty) {
                this.cancelTime = cancelTime;
                this.penalty = penalty;

            }


        }
    }
}
